Open
Conversation
Fully-native LangGraph example app exercising multi-agent orchestration with SDOT auto-instrumentation. Replaces the previous ad-hoc CRM demo with proper LangGraph patterns: TypedDict state, @tool-decorated functions, ChatOpenAI.bind_tools(), ToolNode, and conditional edges. - Records Agent: MongoDB Atlas vector search for orders, tickets, refunds - Policy Agent: RAG-based policy retrieval with drift mode support - Action Agent: LLM-driven tool selection via bind_tools (no manual SDOT) - Audit Agent: Rationale generation with citations - 7 scenarios covering refunds, escalations, order inquiries, hallucination
The action_agent → tool_executor → action_summarise loop created multiple invoke_agent spans. Collapse the tool-calling loop into a single action_node so the trace shape matches the original CRM app: exactly one invoke_agent span per agent (Records, Policy, Action, Audit).
Close behavioral gaps identified by side-by-side review: - Orders vector search: limit 3 → 1 (match old atlas_client.py) - Policy region detection: add missing country codes (USA, ITALY, SPAIN) and default-to-EU for unknown countries - create_ticket / update_ticket: restore `comments` field - Cost model: restore per-tool variable costs instead of flat rate - Resolution logic: add "no_action_required", "refund_state_explained", and "action_failed" to match old _determine_resolution() - AuditOutput: restore `span_ids` field
Extract the monolithic app.py into app/ package matching the original CRM demo repo structure: agents/, models/, rag/, tools/, graph.py. No logic changes — just reorganization for maintainability.
- Pass RunnableConfig to action_node and summarize_node so graph-level callbacks propagate to inner LLM and tool calls - Tools now return JSON strings for reliable output capture - Simplified explain_refund_state and explain_order_state DB lookups - Improved Action Agent prompt for better context adherence
Add scenarios designed to exercise all 15 Galileo eval metrics: - pii_leak_refund: input_pii + output_pii (PII in query, tool echoes it) - prompt_injection_attempt: prompt_injection, context_adherence - toxic_abusive_customer: input_toxicity, input_tone - incomplete_multi_request: completeness, action_completion - tool_failure_scenario: tool_error_rate, action_advancement - vague_rambling_query: agent_efficiency, tool_selection_quality - hostile_context_leakage: output_tone, output_toxicity Add run-sdot-batch.sh for batch execution with mixed scenario plan (30% baseline, 70% metric triggers) and random delay between runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add CRM Ops Desk LangGraph multi-agent demo
Fully-native LangGraph example app exercising multi-agent orchestration
with SDOT auto-instrumentation. Replaces the previous ad-hoc CRM demo
with proper LangGraph patterns: TypedDict state, @tool-decorated
functions, ChatOpenAI.bind_tools(), ToolNode, and conditional edges.